package team.tunan.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import team.tunan.common.Result;
import team.tunan.dto.StockoutDto;
import team.tunan.dto.StockoutPageDto;
import team.tunan.entity.Stockout;
import team.tunan.service.IStockoutService;

/**
 * <p>
 * 销售表	 前端控制器
 * </p>
 *
 * @author sqx
 * @since 2023-12-24
 */
@RestController
@RequestMapping("/stockout")
public class StockoutController {
    @Autowired
    private IStockoutService iStockoutService;

    @PostMapping("/insertStockout")
    public Result insertStockout(@RequestBody Stockout stockout){
        return Result.success(iStockoutService.insertStockout(stockout));
    }

    @PostMapping("/selectPage")
    public Result<Page<StockoutDto>> selectPage(@RequestBody StockoutPageDto stockoutPageDto){
        return Result.success(iStockoutService.selectPage(stockoutPageDto));
    }

}

